-
Notifications
You must be signed in to change notification settings - Fork 73
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
max skew time + batch submission time calculation refactor #1283
Conversation
@@ -314,11 +311,36 @@ func (m *Manager) UpdateLastSubmittedHeight(event pubsub.Message) { | |||
} | |||
} | |||
|
|||
func (m *Manager) GetLastBlockInSettlementTime() (time.Time, error) { | |||
lastBlockInSettlement, err := m.Store.LoadBlock(m.LastSettlementHeight.Load()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the LastSettlementHeight may get pruned no?
pruningHeight = min(m.NextHeightToSubmit(), uint64(retainHeight))
if that's the case and we fallback to first block it may cause unnecessary halt.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
true. good catch. i keep last submitted block without pruning to enable skew time calculation and keep code simplicity.
f9a7024
to
82abf78
Compare
block/submit.go
Outdated
|
||
// isLastBatchRecent returns true if the last batch submitted is more recent than submitBatchTime | ||
// in case of no submission time the first block produced is used as a reference. | ||
func (m *Manager) isLastBatchRecent(submitBatchTime time.Duration) bool { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
submitBatchTime
-> maxBatchSubmitTime
if we don't keep this names clear it becomes really really complicated understanding what each function does.
PR Standards
This PR solves two issues:
Close #1282 ,#1287
<-- Briefly describe the content of this pull request -->
For Author:
godoc
commentsFor Reviewer:
After reviewer approval: